import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import 'element-plus/theme-chalk/dark/css-vars.css'
//忽略当前文件ts类型的检测否则有红色提示(打包会失败)
//@ts-ignore
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
//  svg
import 'virtual:svg-icons-register'
// 全局组件
import gloablComponent from './components'
import './styles/index.scss'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
// pinia持久化
import pinia from './stores/index'
import { setupPermission } from './permisstion'
// 启动微前端配置
import './registerMicroApp.js'
const app = createApp(App)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
// app.use(DataV, { classNamePrefix: 'dv-' })

app.use(pinia)
import './permisstion'
app.use(ElementPlus, {
  locale: zhCn
})
app.use(gloablComponent)
app.use(router)
setupPermission(pinia) // 在 Pinia 初始化之后调用
app.mount('#app')
